﻿using Microsoft.Extensions.DependencyInjection;
using PLCS.App.ConfigManager.ViewModels.Config;
using PLCS.App.ConfigManager.ViewModels.ErrorLibrary;
using PLCS.App.ConfigManager.ViewModels.PLCConfig;
using PLCS.App.ConfigManager.ViewModels.PLCReadData;
using PLCS.App.ConfigManager.Views.Config;
using PLCS.App.ConfigManager.Views.ErrorLibrary;
using PLCS.App.ConfigManager.Views.PLCConfig;
using PLCS.App.ConfigManager.Views.PLCReadData;
using PLCS.Client.IService.ConfigManager;
using PLCS.Client.IService.LogManager;
using PLCS.Client.Service.ConfigManager;
using PLCS.Client.Service.LogManager;
using Prism.Ioc;
using Prism.Modularity;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;

namespace PLCS.App.ConfigManager;

public class ConfigManagerModule : AbpModule, IModule
{
    public void OnInitialized(IContainerProvider containerProvider)
    {
    }

    public void RegisterTypes(IContainerRegistry containerRegistry)
    {
        containerRegistry.RegisterForNavigation<PLCReadDataView, PLCReadDataViewModel>();
        containerRegistry.RegisterForNavigation<PLCReadDataDetailView, PLCReadDataDetailViewModel>();
        containerRegistry.RegisterForNavigation<PLCConfigView, PLCConfigViewModel>();
        containerRegistry.RegisterForNavigation<PLCConfigDetailView, PLCConfigDetailViewModel>();
        containerRegistry.RegisterForNavigation<ConfigView, ConfigViewModel>();
        containerRegistry.RegisterForNavigation<ConfigDetailView, ConfigDetailViewModel>();
        containerRegistry.RegisterForNavigation<ErrorLibraryView, ErrorLibraryViewModel>();
    }

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAutoMapperObjectMapper<ConfigManagerModule>();

        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<ConfigManagerModule>();
        });
    }
}